package com.br.unisal.library.business;


import com.br.unisal.library.exception.ArgumentValidator;
import com.br.unisal.library.exception.NullValueException;

public class Book {
	private Lending lending;
	private String bookName;
	private Identifier identificator;
	
	public Book(String bookName) throws IllegalArgumentException, NullValueException {
		ArgumentValidator.validateNullValue(bookName);
		this.bookName = bookName;
	}

	public boolean isAvailable() {
		boolean isAvailable = true;
		if(this.lending != null){
			isAvailable = false;
		}
		return isAvailable;
	}

	public void setLending(Lending lending) {
		this.lending = lending;	
	}

	public String getBookName() {
		return this.bookName;
	}

	public Identifier getIdentificator() {
		return this.identificator;
	}

	public void setIdentificator(Identifier identificator) {
		this.identificator = identificator; 
		
	}

	public Lending getLending() {
		return this.lending;
	}

}
